import com.leyou.common.utils.JsonUtils;
import com.leyou.order.LyOrderApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

/**
 * @Author: wangying
 * @Description:
 * @Date: Created in  2018/12/1
 */
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = LyOrderApplication.class)
@WebAppConfiguration
public class Text {

   @Autowired
    AmqpTemplate amqpTemplate;
    @Test
    public void contextLoads() {
        for (int i=0;i<1000;i++)
        amqpTemplate.convertAndSend("ly.cart.exchange", "cart.delete", "1111111111"+i);
    }

    @Test
    public void text2() {
        amqpTemplate.convertAndSend("chuanzhi","", "分列模式走起");
    }

    @Test
    public void text1() {
        for (int i=0;i<1000;i++)
        amqpTemplate.convertAndSend("itcast","我要红包"+i);;
    }

    @Test
    public void testSendTopic1(){
        amqpTemplate.convertAndSend("topictext1","good.aaa","主题模式1");
    }


    @Test
    public void testSendTopic2(){
        amqpTemplate.convertAndSend("topictext1","article.content.log","主题模式");
    }

    @Test
    public void testSendTopic3(){
        amqpTemplate.convertAndSend("topictext1","good.log","主题模式");
    }
}
